<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/style.css" />
    <%@include file="../../../common/common-js.jspf" %>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/ckform.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/common.js"></script>

 

    <style type="text/css">
        body {
            padding-bottom: 40px;
            font-size:12px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }
        
        .inputStyle {
		  vertical-align: text-bottom;
		  margin-bottom: 2px;
		  *margin-bottom: -2px;  /* 兼容IE6，IE7 */
		}
    </style>
    <script type="text/javascript">
    	$(function() {
    		$("#addnew").bind("click",function() {
    			
    			location.href="${pageContext.request.contextPath}/user/initAddPage.do";
    		});
    		
    	});
    </script>
</head>
<body>
<form class="form-inline" action="${pageContext.request.contextPath}/user/listUser.do" method="get">
	<table class="table table-bordered definewidth m10">
	    <tr>
	        <td class="tableleft">姓名</td>
	        <td><input type="text" name="userName"/></td>
			<td class="tableleft">电话</td>
	        <td><input type="text" name="phone"/></td>
			<td class="tableleft">添加时间</td>
	        <td><input type="text" id="cstart" name="checkInTime" class="Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'#F{$dp.$D(\'cend\')}',readOnly:true});"/></td>
	        <td class="tableleft">至</td>
	        <td><input type="text" id="cend" name="endCheckInTime" class="Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'cstart\')}',readOnly:true});"/></td>
	    </tr>
		 <tr>
	        <td class="tableleft">性别</td>
	        <td>
	        	<input type="radio" class="inputStyle" name="sex" value="0"/>男&nbsp;&nbsp;
	        	<input type="radio" class="inputStyle" name="sex" value="1"/>女&nbsp;&nbsp;
	        	<input type="radio" class="inputStyle" name="sex" value="-1"/>不限&nbsp;&nbsp;
	        </td>
			 <td class="tableleft">已删除</td>
	        <td>
	        	<input type="radio" class="inputStyle" name="isDelete" value="1"/>是&nbsp;&nbsp;
	        	<input type="radio" class="inputStyle" name="isDelete" value="0"/>否&nbsp;&nbsp;
	        	<input type="radio" class="inputStyle" name="isDelete" value="-1"/>不限&nbsp;&nbsp;
	        </td>
			<td class="tableleft">修改时间</td>
	        <td><input type="text" id="alterstart" name="alterTime" class="Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'#F{$dp.$D(\'alterend\')}',readOnly:true});"/></td>
	        <td class="tableleft">至</td>
	        <td><input type="text" id="alterend" name="endAlterTime" class="Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'alterstart\')}',readOnly:true});"/></td>
	    </tr>
		 <tr>
	        <td class="tableleft">账号</td>
	        <td><input type="text" name="account"/></td>
			<td class="tableleft">Email</td>
	        <td><input type="text" name="email"/></td>
			<td class="tableleft">角色</td>
	        <td>
	        	<select name="roleInfo.roleID" class="selectpicker" data-style="btn-primary">
                	<option value="-1">--请选择--</option>
                	<c:forEach items="${roleInfos}" var="roleInfo">
                		<option value="${roleInfo.roleID }">${roleInfo.roleName }</option>
                	</c:forEach>
                </select>
	        </td>
	        <td class="tablecenter" colspan="2"><button type="submit" class="btn btn-primary btn-lg btn-block">检&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;索</button></td>
	    </tr>
	</table>
</form>
<table class="table table-bordered table-hover definewidth m10">
    <thead>
	    <tr>
	        <th>编号</th>
	        <th>姓名</th>
	        <th>性别</th>
	        <th>账号</th>
	        <th>密码</th>
	        <th>电话</th>
	        <th>邮箱</th>
	        <th>角色</th>
	        <th>录入时间</th>
	        <th>修改时间</th>
	        <th>是否启用</th>
	        <th>操作</th>
	    </tr>
    </thead>
    <c:forEach items="${userList}" var="user">
     	<tr>
           <td>${user.userID }</td>
           <td>${user.userName }</td>
           <td>${user.sex==0?"男":"女"}</td>
           <td>${user.account }</td>
           <td>${user.password }</td>
           <td>${user.phone }</td>
           <td>${user.email }</td>
           <td>${user.roleInfo.roleName }</td>
           <td><fmt:formatDate value="${user.checkInTime }" pattern="yyyy-MM-dd HH:mm:ss" /></td>
           <td><fmt:formatDate value="${user.alterTime }" pattern="yyyy-MM-dd HH:mm:ss" /></td>
           <td>${user.isDelete==0?"启用":"禁用" }</td>
           <td>
           	   <a href="${pageContext.request.contextPath }/user/deleteUser.do?userID=${user.userID }">删除</a>
               <a href="${pageContext.request.contextPath }/user/initUpdateUser.do?userID=${user.userID }">编辑</a>                
           </td>
       </tr>
       </c:forEach>	
</table>
</body>
</html>